package com.cyz.common.dto;

import com.cyz.common.validated.AddGroup;
import com.cyz.common.validated.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.List;

@Data
public class UserDto {

    @Null(message = "id不能规定值",groups = AddGroup.class)
    @NotNull(message = "id不能为空",groups = UpdateGroup.class)
    private Integer id;
    @Null(message = "用户名不能更改",groups = UpdateGroup.class)
    @NotNull(message = "用户名不能为空",groups = AddGroup.class)
    private String userName;
    private String nickName;
    @NotNull(message = "密码不能为空",groups = AddGroup.class)
    private String password;
    private String newPassword;
    private String status;
    private String email;
    private String phonenumber;
    /**
     * 用户类型（0代表普通用户，1代表管理员）
     */
    private String type;
    private String sex;
    private String avatar;
    private List<Integer> roleIds;
}
